//
// Created by wze-zero on 2024/8/12 012.
//
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    string s = "ABCDEF";
    int num = 0;
    for (int i = 0; i < s.length(); ++i) {
        num += (10 + s.at(i) - 'A') * pow(16, s.length() - i - 1);
    }
    cout << setw(15) << num << endl;
    return 0;
}